<!--顶部导航条 -->
<div class="am-container header">
    <ul th:if="!${user}" class="message-l">
        <div class="topMessage">
            <div class="menu-hd">
                <a th:href="'/login'" target="_top" class="h">亲，请登录</a>
                <a th:href="'/register'" target="_top">免费注册</a>
            </div>
        </div>
    </ul>
    <ul th:if="${user}" class="message-l">
        <div class="topMessage">
            <div class="menu-hd">
                <a target="_top" class="h">欢迎你</a>
                <a target="_top" th:text="${user.username}"></a>
            </div>
        </div>
    </ul>
    <ul class="message-r">
        <div class="topMessage home">
            <div class="menu-hd">
                <a th:href="'/'" target="_top" class="h">商城首页</a>
            </div>
        </div>
        <div class="topMessage my-shangcheng">
            <div class="menu-hd MyShangcheng">
                <a href="" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a>
            </div>
        </div>
        <div class="topMessage mini-cart">
            <div class="menu-hd">
                <a id="mc-menu-hd" href="" target="_top">
                    <i class="am-icon-shopping-cart  am-icon-fw"></i>
                    <span>购物车</span>
                    <strong id="J_MiniCartNum" class="h">0</strong>
                </a>
            </div>
        </div>
        <div class="topMessage favorite">
            <div class="menu-hd">
                <a href="" target="_top">
                    <i class="am-icon-heart am-icon-fw"></i><span>收藏夹</span>
                </a>
            </div>
        </div>
    </ul>
</div>

<!--悬浮搜索框-->

<div class="nav white">
    <div class="logoBig">
        <li><img src="/shop/images/logo.png"/></li>
    </div>

    <div class="search-bar pr">
        <a name="index_none_header_sysc" url="search/"></a>
        <form action="/search/" method="post">
            <input id="searchInput" type="text" placeholder="搜索" autocomplete="off"/>
            <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" readonly=""/>
            <input type="hidden" name="link" id="search_url"/>
        </form>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#categories a,each a,.word a,.searchAbout a").click(function () {
            $("#search_url").attr("value", $(this).attr("id"));
            console.log($("#search_url").val())
            $("form").submit();
        })
        $("#ai-topsearch").click(function () {
            $("form").attr("action", "/search&" + $("#searchInput").val());
            $("#search_url").attr("value", "page:1;limit:36;");
            $("form").submit();
        })
        $("#searchInput").keyup(function () {
            var key, e = e || event;
            key = e.keyCode || e.which || e.charCode;
            if (key == 13)
                $("#ai-topsearch").trigger("click");
        })
    })
</script>
<div class="clear"></div>
</div>